<template>
  <div>
    <el-row :gutter="5" class="content">
      <el-col :span="18">
        <el-card class="box-card">
          <div slot="header" class="title">试题列表</div>
          <div v-for="(subject, index) in subjects" :key="subject.subjectId">
            <h3>{{ index + 1 }}. {{ subject.subjectTitle }}</h3>
            <div v-if="subject.subjectType === 2">
              <el-checkbox-group disabled="true" v-model="subject.answers">
                <el-checkbox
                  v-for="option in subject.options"
                  :key="option.optionId"
                  :label="option.optionTitle"
                  style="display: flex"
                >
                  {{ option.optionTitle }}. {{ option.optionContent }}
                </el-checkbox>
              </el-checkbox-group>
            </div>
            <div v-else>
              <el-radio-group disabled="true" v-model="subject.answer">
                <el-radio
                  v-for="option in subject.options"
                  :key="option.optionId"
                  :label="option.optionTitle"
                  style="display: flex"
                >
                  {{ option.optionTitle }}. {{ option.optionContent }}
                </el-radio>
              </el-radio-group>
            </div>
            <div>正确答案: {{ subject.correctAnswer }}</div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card class="box-card">
          <div slot="header" class="title">考试详情</div>
          <div>
            <div class="detail">{{ subjectTitle }}</div>
            <div class="score-detail">
              <div>试题总数: {{ exam.subjectCount }}</div>
              <div>答对题数: {{ exam.correctCount }}</div>
              <div>考试得分: {{ exam.score }}</div>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { BizExamController } from '@/api';
export default {
  name: 'ExamView',
  props: {
    rowData: Object
  },
  data() {
    return {
      sceneType: null,
      moduleType: 3,
      personnelType: this.rowData.personnelType,
      examType: 1,
      exam: this.rowData,
      subjects: this.rowData.subjects,
      subjectTitle: this.rowData.paperName
    };
  },
  methods: {},
  mounted() {},
  created() {}
};
</script>

<style scoped>
.title {
  height: 30px;
  font-size: 16px;
  line-height: 30px;
}
.detail {
  height: 30px;
  font-size: 16px;
  font-style: italic;
  font-weight: bolder;
}
/deep/ .el-radio__label {
  white-space: normal; /* 换行 */
}

/deep/ .el-checkbox__label {
  white-space: normal; /* 换行 */
}
.score-detail > div {
  margin: 5px 0px;
  font-size: 14px;
  font-weight: bolder;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    '微软雅黑', Arial, sans-serif;
}
</style>
